package com.hjn.study.singleton;

public class LazyDesgin {
    private LazyDesgin() {
        System.out.println("lazyType");
    }
    public static LazyDesgin lazyDesgin = null;
    public LazyDesgin getInstance(){
        //双重检查机制
        if (lazyDesgin==null){
            synchronized (LazyDesgin.class){
                if (lazyDesgin==null){
                    lazyDesgin = new LazyDesgin();
                }
            }
        }
        return lazyDesgin;
    }
}
